public class Factorial {
    public static int factorial(int n) {
        if(n <= 1) {
            return 1;
        }
        else return n * factorial(n - 1);
    }
    public static void main(String[] args) {
        int n = 5;
        int c = 0;
        for(int i = 1;i  <= 5;i++) {
            c += factorial(i);
        }
        System.out.println(c);
    }
}
